#!/usr/bin/env node

const http = require('http'),
      log  = require('uti1').debuglog('dev'),
      fs   = require('fs');

http.createServer((req,res)=>{
  log(`${req.method} ${req.url} HTTP/${req.httpVersion}`);
  log(req.headers);
  log(process.pid);
  log();

  let fileName = __dirname + req.url,
      fileData = fs.readFileSync(fileName);

  res.end(fileData);
}).listen(8080);
